import { request, getToken } from '@inbiz/utils';
export async function getPaths(params) {
  if (params.advancedSearch) {
    return request('/WebCore', {
      method: 'POST',
      requestType: 'form',
      data: {
        module: 'WebClient',
        fun: 'GetFolderChildren',
        fid: params.folderId,
        isPerson: false,
        noCalcPerm: true,
        argsXml: '<GetListArgs><PageNum>1</PageNum></GetListArgs>'
      },
    })
  }
  return request(`/search/IndexSearch/GetSectionDataByField?token=${getToken()}`, {
    method: 'post',
    requestType: 'form',
    data:{
      ...params,
    }
  })
}

export async function getEcmTeams() {

  return request('/WebCore', {
    method: 'POST',
    requestType: 'form',
    data: {
      module: 'WebClient',
      fun: 'GetMyTeamChildren',
      fid: 7,
      pageSize: 999,
      pageNum: 1,
      sortName: 'team_createTime',
      desc: true,
      needUserType: true,
    },
  })
}
